package com.ruoyi.produce.process.productionLine.service;

import com.ruoyi.produce.process.productionLine.domain.ProductionLineCond;
import com.ruoyi.produce.process.productionLine.domain.ProductionLineDomain;
import com.ruoyi.produce.process.productionLine.domain.ProductionLineDto;
import com.ruoyi.produce.process.productionLine.mapper.ProductionLineMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 业务处理层
 */
@Service
public class ProductionLineServiceImpl implements IProductionLineService{
    @Autowired
    private ProductionLineMapper productionLineMapper;
    /**
     * 根据搜索条件所有产线
     * @param cond
     * @return
     */
    @Override
    public List<ProductionLineDto> selectProductionLineList(ProductionLineCond cond) {
        return productionLineMapper.selectProductionLineList(cond);
    }

    /**
     * 根据产线编号搜索具体的产线记录
     * @param productionLineId
     * @return
     */
    @Override
    public ProductionLineDto selectProductionLineById(int productionLineId) {
        return productionLineMapper.selectProductionLineById(productionLineId);
    }

    /**
     * 新增产线
     * @param productionLine
     * @return
     */
    @Override
    public int insertProductionLine(ProductionLineDomain productionLine) {
        return productionLineMapper.insertProductionLine(productionLine);
    }

    /**
     * 更新产线
     * @param productionLine
     * @return
     */
    @Override
    public int updateProductionLine(ProductionLineDomain productionLine) {
        return productionLineMapper.updateProductionLine(productionLine);
    }

    /**
     * 删除产线
     * 仅修改员工删除标志
     * @param productionLine
     * @return
     */
    @Override
    public int updateProductionLineDeleteFlag(ProductionLineDomain productionLine) {
        return productionLineMapper.updateProductionLineDeleteFlag(productionLine);
    }
}
